Skip to main content

All Questions

6votes
2answers
205views

Programming Language Source Lexer

I have a lexer (program that turns source code into tokens) written in Go that I am re-writing in Rust. The lexer should take in a sequence of tokens, generally different special characters, integers, ...
John Allison's user avatar
1vote
1answer
167views

Rust state-machine lexer

I tried implementing a lexer in rust that peeks ahead at the next character and makes a decision based on that. However, i am told that this is bad practice, and instead i should be using finite-state-...
xxxxxxxxxx's user avatar
0votes
1answer
179views

supporting unicode in rust lexer

I am working on a lexer in rust. It has been through many different iterations, going from iterating over a Vec<char> to ...
xxxxxxxxxx's user avatar
4votes
1answer
438views

lexer for programming languages in rust

I'm relatively new to rust, so you don't need to go easy on the criticism. right now, this lexes 1MB of text (well, trims a 1MB-long word) in 30ms. is there any way I can make this faster? cursor.rs: <...
xxxxxxxxxx's user avatar
0votes
1answer
132views

top-down lexer in rust

the other day, i decided to build a top-down lexer in rust, just for fun. this is what i have so far: ...
John doe's user avatar
1vote
1answer
111views

Lexer for shell-like language [rust]

I am working on writing a rust implementation of a sh-like language. Rather than posting 600 lines of code here, you can just go to the GitHub repository. Is this a ...
CATboardBETA's user avatar
6votes
1answer
231views

Lexer for a Scheme-like language in rust

I was/am working on an interpreter for a scheme-like language. Just some time back I shifted my implementation from C++ to Rust, which I just started learning. I know there are parser libraries like ...
Bhargav Kulkarni's user avatar
2votes
1answer
230views

Tokenizer FSM in Rust - better way to do match statements?

I'm learning Rust and have decided to code up a toy YANG parser as an exercise. In case it's relevant, I mainly work in C and Python. While working on the tokenizer/lexer, I tried to make it Rust-y, ...
Kyle_S-C's user avatar
5votes
1answer
860views

Lexer written in Rust

So I ported a lexer I wrote in C++ over to rust, as I'm starting to learn rust. Since I'm very new though, I don't know any Idioms and good practices in rust. So if anyone could point out some (...
Ian Rehwinkel's user avatar
3votes
1answer
174views

Lex Scheme in Rust

I'm writing a Scheme interpreter in Rust, and the first step is the parser. I've finished the lexer, and would like to see what people think of it before I go any further. ...
Simon Brahan's user avatar

close